#ifndef TRAMSPAGE_H
#define TRAMSPAGE_H

#include <QWidget>
#include "types.h"
class QVBoxLayout;
class QVBoxLayout;
class QHBoxLayout;
class QLabel;
class QSlider;
class QSpinBox;
class QCheckBox;
class QComboBox;
class QGridLayout;
class QPushButton;
class Options;

class TramsPage : public QWidget
{
    Q_OBJECT
public:
    explicit TramsPage(Options *parent = 0);
    void saveTramsSettings();
    void readTramsSettings();
    int getNumRails();
    RailBed indexToRailBed(QComboBox *box);

public slots:
    void numBranchesChanged(int numBranches);
    void changeNumRails(int newNumRails);
    void roadsDirectionChanged(int ind);
    void groundChanged(int); //zmienił się onroad na ongrass lub odwrotnie

private:
    int _numBranches;
    void createNumRailsWidgets();
    void createRailsProperties(int numRails);
    void configureTramPage();
    void  deleteRailsProperties();
    void setTrackNumber(int i);

    QVBoxLayout *_mainLayout;
    QLabel *_zrodloLabel;
    QLabel *_podlozeZrodloLabel;
    QLabel *_celLabel;
    QLabel *_podlozeCelLabel;

    QLabel *_iloscTorowLabel;
    QSpinBox *_iloscTorowSpinBox;
    QSlider *_iloscTorowSlider;
    QHBoxLayout *_iloscTorowLayout;

    QGridLayout *_toryLayout;
    QList <QLabel*> _torLabel;
    QList <QComboBox*> _numerZrodlaComboBox;
    QList <QComboBox*> _podlozeZrodlaComboBox;
    QList <QComboBox*> _numerCeluComboBox;
    QList <QComboBox*> _podlozeCeluComboBox;

    Options *myParent;
};

#endif // TRAMSPAGE_H
